package testing.com.vtls.oai.service.providers;

import com.vtls.oai.service.providers.SolrProvider;
import junit.framework.TestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
import org.apache.solr.client.solrj.SolrServer;

public class SolrProviderTestCase extends TestCase
{
   private final Log log = LogFactory.getLog(getClass());

	public SolrProviderTestCase(String name)
	{
		super(name);
	}

	protected void setUp()
	{
   }

	protected void tearDown()
	{
	}

	public void testLifeCycle() throws Exception
	{
	   final SolrServer solrServer = new CommonsHttpSolrServer("http://localhost:8080/solr");
	   final SolrProvider provider = new SolrProvider();
	   provider.setSolrServer(solrServer);
	   provider.setQuery("datastream:MARCDESC");
	   
	   log.info(provider.listRecords(null).size());
	   
      assertTrue(true);
	}
}
